package com.changgou.seckill.task;

import com.changgou.seckill.dao.SeckillGoodsMapper;
import entity.DateUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import java.util.Date;
import java.util.List;

/**
 * @ClassName SeckillGoodsPushRedis
 * @Description
 * @Author Mr.L
 * @Date 21:19 2019/11/27
 * @Version 2.1
 **/
@Component
public class SeckillGoodsPushRedis {

    @Autowired(required = false)
    private SeckillGoodsMapper seckillGoodsMapper;

    @Autowired
    private RedisTemplate redisTemplate;

    @Scheduled(cron = "0/5 * * * * ?")
    public void pushGoodsToRedis(){
        // 获取当前时间后的5个时间段
        List<Date> dateMenus = DateUtil.getDateMenus();
    }

}
